package com.csdnn;

public class Test3 {
    public static void main(String[] args) {
        B b = new B();
        b.m(new A() {
            @Override
            public void eat() {
                System.out.println("哈哈哈");
            }
        });
    }
}


interface A{
    void eat();
}

class B{
    public void m(A a) {
    a.eat();
    }
}